<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="org.jeecgframework.web.util.StaticValue" %>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <title>返件详情页</title>
    <t:base type="jquery,easyui,tools,DatePicker"></t:base>
    <script type="text/javascript" src="plug-in/ckfinder/ckfinder.js"></script>
    <link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css"/>
    <script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.min.js"></script>
    <script type="text/javascript" src="plug-in/jquery/ajaxfileupload.js"></script>
    <script type="text/javascript" src="plug-in/jquery/jquerysession.js"></script>
    <script type="text/javascript">
        //编写自定义JS代码
        $(document).ready(function () {
            getContacts();

            if($('#roleType').val()=='GCS'){
                //$('#qhContactsDiv').hide()
                //$('#logisticsDiv').hide()
                $('#backDiv').hide()
            }
            if($('#roleType').val()=='WL'){
                //$('#qhContactsDiv').hide()
                //$('#logisticsDiv').hide()
                $('.wlHide').hide()
            }

        })

        function lookImg(id) {
            //alert(id)
             addOneTab('预览','cbsServiceController.do?openViewFile&fileid='+id)
        }


        function getContacts(){
            var logisticsName = $("#logistics").text();
            $.ajax({
                type:"GET",
                data:{"code":logisticsName},
                url:"cbsDelinerController.do?getContacts",
                dataType:"json",
                success:function (data) {
                    var tbs = data.obj;
                    if(tbs==null || tbs==""){
                        $("#userName").text("暂无信息");
                        $("#cellphone1").text("暂无信息");
                        $("#email").text("暂无信息");
                    }else{
                        $("#userName").text(tbs.name);
                        $("#cellphone1").text(tbs.cellphone1);
                        $("#email").text(tbs.email);
                    }
                }
            });
        }
        
        
        function closeTabs() {
            closetab('返件详情');
        }
    </script>
    <style type="text/css">
        .noSelect {
            border: 0;
            /*display: block;*/
            /*position: relative;*/
            min-height: 1.146667rem;
            line-height: 1.146667rem;
            white-space: nowrap;
            /*width: 100%;*/
            overflow: hidden;
            padding-right: .6rem;
            background-color: #eee;
            background: transparent;
            appearance: none;
            -moz-appearance: none; /* Firefox */
            -webkit-appearance: none; /* Safari 和 Chrome */
        }
    </style>
</head>
<body>
<div style="margin-bottom:10px;">
    <img style="margin-bottom:-7px" src="plug-in/login/images/dispatch bill.png">
    <span class="list-title" id="reTurnCode">${cbsReturnEquipmentPage.code}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <span style="font-size:13px;">状态：<span style="color: red">${status}
       <%-- <t:dictSelect field="status" id="status" clazz="noSelect" readonly="true"
                      typeGroupCode="<%=StaticValue.RETURN_STATUS_Log_Type%>"
                      defaultVal="${cbsReturnEquipmentPage.status}">
        </t:dictSelect>--%>
    </span></span>
    <input id="roleType" hidden="hidden" value="${type}">
</div>
<div class="subtitle">
    <p>关联信息</p>
    <table class="nobordertable noborder">
        <tbody>
        <tr>
            <td class="al_r" width="20%">
                <label>服务单号CR:</label>
            </td>
            <td width="30%">
                ${cbsReturnEquipmentPage.crCode}
            </td>
            <td class="al_r" width="20%">
                <label>备件申请单号:</label>
            </td>
            <td width="30%">
                ${cbsReturnEquipmentPage.equipmentApplyId.recordId}
            </td>
        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>发货单号:</label>
            </td>
            <td width="30%">
                ${cbsReturnEquipmentPage.deliverCode}
            </td>
            <td class="al_r" width="20%">
                <label>SR:</label>
            </td>
            <td width="30%">
                ${cbsReturnEquipmentPage.srCode}
            </td>
        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>SO:</label>
            </td>
            <td width="30%">
                ${cbsReturnEquipmentPage.soCode}
            </td>
            <td class="al_r" width="20%">

            </td>
            <td width="30%">

            </td>
        </tr>
        </tbody>
    </table>
</div>

<div class="subtitle">
    <p>返件信息</p>
    <c:forEach items="${cbsReturnEquipmentDetailEntities}" var="r" varStatus="i">
        <input type="hidden" name="rd_" id="rd_" value="${r.id}">
        <div style="margin-top:20px; width: 98%; margin: 0px auto;"><span
                style="font-weight: bold;">返件：${i.index+1}</span></div>
        <div class="l-div">
            <table class="nobordertable noborder" style="border: none;">
                <tbody>
                <tr>
                    <td class="al_r" width="20%">
                        <label>类型:</label>
                    </td>
                    <td width="30%">
                            ${r.typeId.typeDesc}
                    </td>
                    <td class="al_r" width="20%">
                        <label>备件号:</label>
                    </td>
                    <td width="30%">
                            ${r.item}
                    </td>
                </tr>
                <tr>
                    <td class="al_r" width="20%">
                        <label>状态:</label>
                    </td>
                    <td width="30%">
                            <c:if test="${r.returnEquipmentStatus==1}">DOA</c:if>
                            <c:if test="${r.returnEquipmentStatus==2}">好件</c:if>
                            <c:if test="${r.returnEquipmentStatus==3}">坏件</c:if>
                    </td>
                    <td class="al_r wlHide" width="20%">
                        <label>序列号:</label>
                    </td>
                    <td width="30%" class="wlHide">
                         ${r.sn}
                    </td>
                </tr>
                <tr class="wlHide">
                    <td class="al_r" width="20%" valign="top">
                        <label>备注:</label>
                    </td>
                    <td width="30%">
                            ${r.memo}
                    </td>
                    <td class="al_r wlHide" width="20%" valign="top">
                        <label>二维码:</label>
                    </td>
                    <td width="30%" class="wlHide">
                        ${r.equipmentErcode}
                    </td>
                </tr>
                <tr>
                    <td class="al_r" width="20%" valign="top">
                        <label>备件照片:<font color="red">*</font></label>
                    </td>
                    <td width="30%">
                        <c:forEach items="${detailFileList}" var="detailFile">
                            <c:if test="${detailFile.businessChildType==r.id}">
                                <%--<a  style="color: #0e90d2"  onclick="lookImg('${detailFile.id}')">${detailFile.oldFileName}</a>--%>
                                <a style="color: blue;text-decoration: underline" href="fileUploadController.do?downLoadFile&fileLogId=${detailFile.id}">${detailFile.oldFileName}</a>&emsp;
                            </c:if>
                        </c:forEach>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </c:forEach>
</div>
<div class="subtitle" id="qhContactsDiv">
    <p>取货联系人信息</p>
    <table class="nobordertable noborder" style="border: none;">
        <tbody>
        <tr>
            <td class="al_r" width="20%">
                <label>姓名:</label>
            </td>
            <td width="30%">
                ${cbsReturnEquipmentPage.name}
            </td>
            <td class="al_r" width="20%">
                <label>电话:</label>
            </td>
            <td width="30%">
                ${cbsReturnEquipmentPage.phone}
            </td>
        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>取货地址:</label>
            </td>
            <td width="30%">
                ${cbsReturnEquipmentPage.sheng.territoryName}&emsp;${cbsReturnEquipmentPage.shi.territoryName}&emsp;${cbsReturnEquipmentPage.address}
            </td>
            <td class="al_r" width="20%">
                <label>影院名称:</label>
            </td>
            <td width="30%">
                ${cbsReturnEquipmentPage.cinemaName}
            </td>
        </tr>
        </tbody>
    </table>
</div>
<div class="subtitle" id="logisticsDiv">
    <p>物流</p>
    <table class="nobordertable noborder" style="border: none;">
        <tbody>
        <tr>
            <td class="al_r" width="20%">
                <label>发货物流:</label>
            </td>
            <td width="30%">
                <span id="logistics">${cbsReturnEquipmentPage.logistics}</span>
            </td>
            <td class="al_r" width="20%">
                <label>联系人:</label>
            </td>
            <td width="30%">
                <span id="userName"></span>
            </td>
        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>电话:</label>
            </td>
            <td width="30%">
                <span id="cellphone1"></span>
            </td>
            <td class="al_r" width="20%">
                <label>邮箱:</label>
            </td>
            <td width="30%">
                <span name="email" id="email"></span>
            </td>
        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>预计取货时间:</label>
            </td>
            <td width="30%">
                <span id="pickupTime" name="pickupTime">${cbsReturnEquipmentPage.pickupTime}</span>
            </td>
            <td class="al_r" width="20%">
                <label>预计回库时间:</label>
            </td>
            <td width="30%">
                <span id="backwarehouseTime" name="backwarehouseTime" >${cbsReturnEquipmentPage.backwarehouseTime}</span>
            </td>
        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>物流单号:</label>
            </td>
            <td width="30%">
                <span id="logisticsCode" name="logisticsCode">${cbsReturnEquipmentPage.logisticsCode}</span>
            </td>
            <td class="al_r" width="20%">
            </td>
            <td width="30%">
            </td>
        </tr>
        </tbody>
    </table>
</div>
<div class="subtitle" id="backDiv">
    <p>入库信息</p>
    <c:forEach items="${cbsBackEquipmentDetailEntities}" var="b" varStatus="i">
        <div style="margin-top:20px; width: 98%; margin: 0px auto;">
            <span style="font-weight: bold;">返件：${i.index+1}</span>
        </div>
        <div class="l-div">
            <table class="nobordertable noborder" style="border: none;">
                <tbody>
                <tr>
                    <td class="al_r" width="20%">
                        <label>类型:</label>
                    </td>
                    <td width="30%">
                         ${b.returnEquipmentDetailId.typeId.typeDesc}
                    </td>
                    <td class="al_r" width="20%">
                        <label>备件号:</label>
                    </td>
                    <td width="30%">
                            ${b.item}
                    </td>
                </tr>
                <tr>
                    <td class="al_r" width="20%">
                        <label>序列号:</label>
                    </td>
                    <td width="30%">
                            ${b.sn}
                    </td>
                    <td class="al_r" width="20%">
                        <label>物料号:</label>
                    </td>
                    <td width="30%">
                            ${b.verCode}
                    </td>
                </tr>
                <tr>
                    <td class="al_r" width="20%" valign="top">
                        <label>二维码:</label>
                    </td>
                    <td width="30%">
                            ${b.equipmentErcode}
                    </td>
                    <td class="al_r" width="20%" valign="top">
                        <label>版本号:</label>
                    </td>
                    <td width="30%">
                            ${b.verCode}
                    </td>
                </tr>
                <tr>
                    <td class="al_r" width="20%" valign="top">
                        <label>仓库:</label>
                    </td>
                    <td width="30%">
                            ${b.warehouseId.name}
                    </td>
                    <td class="al_r" width="20%" valign="top">
                        <label>库位:</label>
                    </td>
                    <td width="30%">
                            ${b.warehousePosition}
                    </td>
                </tr>
                <tr>
                    <td class="al_r" width="20%" valign="top">
                        <label>备注:</label>
                    </td>
                    <td width="30%">
                            ${b.memo}
                    </td>
                    <td class="al_r" width="20%" valign="top">
                        <label>开箱检查:</label>
                    </td>
                    <td width="30%">
                        <c:forEach items="${openCheckList}" var="openCheck">
                            <c:if test="${openCheck.typecode==b.openCheck}">${openCheck.typename}</c:if>
                        </c:forEach>
                    </td>
                </tr>
                    <td class="al_r" width="20%" valign="top">
                        <label>备件照片:</label>
                    </td>
                    <td width="30%">
                        <c:forEach items="${backFileList}" var="backFile">
                            <c:if test="${backFile.businessChildType==b.returnEquipmentDetailId.id}">
                                <%--<a  style="color: #0e90d2"  onclick="lookImg('${backFile.id}')">${backFile.oldFileName}</a>--%>
                                <a style="color: blue;text-decoration: underline" href="fileUploadController.do?downLoadFile&fileLogId=${backFile.id}">${backFile.oldFileName}</a>&emsp;
                            </c:if>
                        </c:forEach>
                    </td>
                    <td class="al_r" width="20%" valign="top">

                    </td>
                    <td width="30%">

                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </c:forEach>
    <div>
        <table class="nobordertable noborder" style="border: none;">
            <tbody>
            <tr>
                <td class="al_r" width="20%" valign="top">
                    <label>未达标原因:</label>
                </td>
                <td width="30%">
                    ${cbsReturnEquipmentPage.unqualified}
                </td>
                <td class="al_r" width="20%" valign="top">

                </td>
                <td width="30%">

                </td>
            </tr>
            <tr>
                <td class="al_r" width="20%" valign="top">
                    <label>未达标备注:</label>
                </td>
                <td colspan="3">
                    ${cbsReturnEquipmentPage.unqualifiedMemo}
                    <%--<textarea style="width: 100%; height: 60px;" readonly="readonly" maxlength="255" id="unqualifiedMemo" name="unqualifiedMemo">${cbsReturnEquipmentPage.unqualifiedMemo}</textarea>--%>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<div class="subtitle">
    <p>日志</p>
    <table class="ftable">
        <tbody>
        <tr>
            <th>操作人</th>
            <th>时间</th>
            <th>描述</th>
        </tr>
        <c:forEach items="${cbsHandleLogEntities}" var="i">
            <tr>
                <td>${i.createName}</td>
                <td><fmt:formatDate value="${i.createDate}" type="date" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                <td>${i.description}</td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>

</body>

</html>
